package com.android.fragmentdemo.adapters
import com.android.fragmentdemo.databinding.RvDynamicLayout01Binding
import com.android.fragmentdemo.databinding.RvHeaderLayoutBinding
import com.hengfoxwolf.commonbase.base.adapter.BaseRvWithHeaderAdapter

class HeaderBodyRVAdapter(headContent: String) :
    BaseRvWithHeaderAdapter<String, RvHeaderLayoutBinding, RvDynamicLayout01Binding>(
        RvHeaderLayoutBinding::inflate,
        RvDynamicLayout01Binding::inflate
    ) {

    private val mHeadContent = headContent

    override fun bindHeaderData(holder: ViewHolder, position: Int) {
        (holder.binding as? RvHeaderLayoutBinding)?.apply {
            itemTitleTv.text = mHeadContent
        }
    }

    override fun bindData(holder: ViewHolder, dataItem: String, position: Int) {
        (holder.binding as? RvDynamicLayout01Binding)?.apply {
            itemDy01.text = dataItem
        }
    }
}